<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
    <style>
        *{
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <div id="root">
        <form @submit.prevent="sub">
            账号：<input type="text" v-model.trim="account"><br/>
            密码：<input type="password" v-model="password"><br/>
            性别：
            男<input type="radio" name="sex" value="man" v-model="sex">
            女<input type="radio" name="sex" value="woman" v-model="sex"><br/>
            年龄：<input type="number" v-model.number="age"><br/>
            爱好：
            吃饭<input type="checkbox" value="eat" v-model="hobby">
            喝水<input type="checkbox" value="drink" v-model="hobby">
            上厕所<input type="checkbox" value="bathroom" v-model="hobby"><br/>
            所属校区：
            <select v-model="city">
                <option value="0">请选择所属校区</option>
                <option value="1">上海</option>
                <option value="2">北京</option>
                <option value="3">广州</option>
            </select><br/>
            其他信息：<br/>
            <textarea v-model.lazy="other"></textarea><br/>
            <input type="checkbox" v-model="isAggre">阅读并接受<a href="http://www.baidu.com">《用户协议》</a><br/>
            <button>提交</button>
        </form>
    </div>
    
    <script type="text/javascript">
        new Vue({
            el:"#root",
            data:{
                account:'',
                password:'',
                sex:'man',
                age:'',
                hobby:[],
                city:'1',
                other:'',
                isAggre:''
            },
            methods: {
                sub(){
                    console.log(this._data)
                }
            }
        })
    </script>
</body>
</html>